package com.ebelter.btcomlib.models.bluetooth.bean;

import com.ebelter.btcomlib.utils.TimeUtils;

import java.util.Arrays;

/**
 * 消息包
 */

public class SendMessage {

    public long productTime;//此消息产生的时间

    public int type;//数据类型

    public String desc;//此数据的中文描述,增加此字段为了调试方便

    public int reSendCount=0;//如果发送失败 需要重复发送的次数

    public int sendCount=0;//发送的次数

    public byte[] datas;//发送的内容
    public byte[] srcDatas;//发送的元内容

    public boolean isNeedEncrypt = false;
    public SendMessage() {
        this.productTime = System.currentTimeMillis();
    }

    @Override
    public String toString() {
        return "SendMessage{" +
                "productTime =" + TimeUtils.formatTime2(productTime) +
                ", type=" + type +
                ", sendCount=" + sendCount +
                ", desc='" + desc + '\'' +
                ", reSendCount=" + reSendCount +
                ", srcDatas=" + Arrays.toString(srcDatas) +
                "\n, datas=" + Arrays.toString(datas) +
                '}';
    }
}
